<%@ page import="com.lagou.task.service.StudentService" %>
<%@ page import="com.lagou.task.model.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: lujin
  Date: 2022/3/7
  Time: 23:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>显示全部学生</title>
</head>
<body>
<table height="100" width="450" border="1">
    <tr>
        <td>学&nbsp;&nbsp;号</td>
        <td>姓&nbsp;&nbsp;名</td>
        <td>性&nbsp;&nbsp;别</td>
        <td>出生日期</td>
        <td>邮&nbsp;&nbsp;箱</td>
        <td>备&nbsp;&nbsp;注</td>
    </tr>
    <%
        Object students = request.getSession().getAttribute("stds");
        if(students instanceof ArrayList<?>){
            List<?> stds = (List<?>) students;
            for (Object student : stds) {
    %>
    <tr>
        <td><%= ((Student) student).getsId()%>
        </td>
        <td><%= ((Student) student).getsName()%>
        </td>
        <td><%= ((Student) student).getsSex()%>
        </td>
        <td><%= ((Student) student).getsBirth()%>
        </td>
        <td><%= ((Student) student).getsEmail()%>
        </td>
        <td><%= ((Student) student).getsNote()%>
        </td>
    </tr>
    <%
            }}%>
</table>
<form action="main.jsp" method="post">
    <input type="submit" value="返回">
</form>
</body>
</html>
